﻿using System;
using System.Collections.ObjectModel;
using System.Windows.Forms;
using HMIWebDisplay;

namespace HMIWebGhostRemover
{
    public partial class Form1 : Form
    {

        private ObservableCollection<DisplayFile> _displayFiles = new ObservableCollection<DisplayFile>();

        public Form1()
        {
            InitializeComponent();
            buttonLoadDisplay.Click += ButtonLoadDisplayClick;
            buttonRemoveGhosts.Click += ButtonRemoveGhostsClick;
            listBoxGhosts.DataSource = _displayFiles;
        }

        void ButtonRemoveGhostsClick(object sender, EventArgs e)
        {
        }

        void ButtonLoadDisplayClick(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.DefaultExt = ".htm";
            openFileDialog.Filter = "HMI Web Display (.htm)|*.htm";
            openFileDialog.Multiselect = true;

            if (openFileDialog.ShowDialog() == DialogResult.Cancel)
                return;

            foreach (var fileName in openFileDialog.FileNames)
                _displayFiles.Add(new DisplayFile(fileName));
        }

    }
}
